package order.infrastructure.repository;

import order.domain.model.OrderItem;
import order.domain.repository.OrderItemRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public class OrderItemRepositoryImpl implements OrderItemRepository {

    @Autowired
    private JpaOrderItemRepository jpaOrderItemRepository;

    @Override
    public void saveAll(List<OrderItem> items) {
        jpaOrderItemRepository.saveAll(items);
    }

    @Override
    public List<OrderItem> findByOrder_OrderId(Long orderId) {
        return jpaOrderItemRepository.findByOrder_OrderId(orderId);
    }
}